
function NewShare(url){
	var beforediv = $("#share1");;
	$(".sharecontent p").mouseover(function(){
		if(beforediv){
			beforediv.css("display","none");
		}
		var newcontentId = $(this).attr("content");
		var $nowcontent = $("#"+newcontentId);
		$nowcontent.css("display","block");
		beforediv = $nowcontent;
	});
	
	$("#newSharePanel .paging span").click(function(){
		var page = $(this).attr("page");
		LoadShare(url,page);
	});
}


//加载最新分享
function LoadShare(url,currentpage){
	$("#shareContent").load(url+"/shareMessage?currentpage="+currentpage,"",function(){
                $("#share1").css("display","block");
		NewShare(url);
	});
}

function LoadQuestion(url,currentpage){
	$("#questionContent").load(url+"/questionMessage?currentpage="+currentpage,"",function(){
		NewQuestion(url);
	})
}

function NewQuestion(url){
	var  beforespan = [];
	beforespan.push($("#questiondatil1_"));
	beforespan.push($("#_questiondatil1"));
	$(".questiondetail .synopsis").mouseover(function(){
		if(beforespan){
			for(var i=0;i<beforespan.length;i++){
				beforespan[i].addClass("none");
			}
		}
		var contentId = $(this).attr("content");
		var $_span = $("#_"+contentId);
		var $span_= $("#"+contentId+"_");
		beforespan=[];
		beforespan.push($_span);
		beforespan.push($span_);
		$_span.removeClass("none");
		$span_.removeClass("none");
		
	});
	
	$(".questioncontent .paging span").click(function(){
		var page = $(this).attr("page");
		LoadQuestion(url,page);
	});
}

